<html>
<head>
    <title>Jan! &raquo; PHP &raquo; speed test</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" language="Javascript">
    var imageAddr = "images/pic01-big.jpg" + "?n=" + Math.random() ;
    var startTime, endTime ;
	var downloadSize = 200000 ;
	var download = new Image() ;
	download.onload = function() {
		endTime = (new Date()).getTime() ;
		showResults () ;
	}
	startTime = (new Date()).getTime() ;
	download.src = imageAddr ;
	function showResults () {
		var duration = Math.round((endTime - startTime) / 1000) ;
		var bitsLoaded = downloadSize * 8 ;
		var speedBps = Math.round(bitsLoaded / duration) ;
		var speedKbps = (speedBps / 1024).toFixed(2) ;
		var speedMbps = (speedKbps / 1024).toFixed(2) ;
		alert ("Your connection speed is: \n" +
		speedBps + " bps\n" +
		speedKbps + " kbps\n" +
		speedMbps + " Mbps\n") ;
	}
	</script>
</head>
<body>
</body>